# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=bzr-fastimport
pkgver=0.13.0
pkgrel=1
pkgdesc="Bazaar Fast Import is a plugin providing fast loading of revision control data into Bazaar."
arch=('any')
url="https://launchpad.net/bzr-fastimport"
license=('GPL2')
depends=('bzr' 'python2-fastimport')
source=("http://launchpad.net/${pkgname}/trunk/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz"
        "helpers.patch")
md5sums=('e47115774d44ae0c3b027ae0374aa52e'
         '629f233bf6b0af41ccff6d561d2c91b2')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  # Remove calls to helpers that have been obsoleted in python2-fastimport
  #  - http://bazaar.launchpad.net/~jelmer/python-fastimport/trunk/revision/328
  #  - http://bazaar.launchpad.net/~jelmer/python-fastimport/trunk/revision/327
  patch -Np1 -i "${srcdir}/helpers.patch"
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  python2 setup.py install --root="${pkgdir}" --optimize=1
}
